package com.woniuxy.yoga.business.client;

import com.woniuxy.yoga.business.model.client.AdminRole;
import com.woniuxy.yoga.business.model.client.Resource;
import com.woniuxy.yoga.business.model.client.RoleResource;
import com.woniuxy.yoga.business.model.form.businesspayment.PaymentLogForm;
import com.woniuxy.yoga.commons.core.model.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "admin-service",path = "/admin")
public interface AdminClient {

    /**
     * 新增商家缴费日志
     * @param form
     * @return
     */
    @PostMapping("/paymentLog/addPaymentLog")
    public Result<Boolean> addPaymentLog(@RequestBody PaymentLogForm form);

    /*
     * 根据账号ID查询管理员角色
     * */
    @GetMapping("/adminRole/selectRoleByAccountId/{accountId}")
    public Result<AdminRole> selectRoleByAccountId(@PathVariable("accountId")Integer accountId);

    /*
     * 根据角色ID查资源权限
     * */
    @GetMapping("/roleResource/selectResourceByRole/{roleId}")
    public Result<List<RoleResource>> selectResourceByRole(@PathVariable("roleId") Integer roleId);

    /**
     * 通过资源ID集合查询资源集合
     * @param resourceIds
     * @return
     */
    @PostMapping("/resource/selectResourceByIds")
    public Result<List<Resource>> selectResourceByIds(@RequestBody List<Integer> resourceIds);

}
